//
//  AppConfigure.swift
//  Extend
//
//  Created by shufang zou on 2017/8/4.
//  Copyright © 2017年 敬信. All rights reserved.
//

public class AppConfigureModel {
    var viewBgColor: UIColor?;
    var navBgColor: UIColor?;
    var navShadowColor: UIColor?;
    var navStatusBarColor: UIColor?;
    var tableBgColor: UIColor?;
    var refreshTextColor: UIColor?;
    var refreshTextFont: UIFont?;
    var errTextColor: UIColor?;
    var errTextFont: UIFont?;
    var progressTextColor: UIColor?;
    var progressBgColor: UIColor?;
    var progressTextFont: UIFont?;
    var navStatusBarImage: UIImage?;
    
    fileprivate init() {
    }

    public class func newBuilder() -> AppConfigureBuilder {
        return AppConfigureBuilder();
    }
}

public class AppConfigureBuilder {
    var viewBgColor: UIColor?;
    var navBgColor: UIColor?;
    var navShadowColor: UIColor?;
    var navStatusBarColor: UIColor?;
    var tableBgColor: UIColor?;
    var refreshTextColor: UIColor?;
    var refreshTextFont: UIFont?;
    var errTextColor: UIColor?;
    var errTextFont: UIFont?;
    var progressTextColor: UIColor?;
    var progressBgColor: UIColor?;
    var progressTextFont: UIFont?;
    var navStatusBarImage: UIImage?;
    
    fileprivate init() {
        
    }

    public func viewBgColor(_ color: UIColor) -> Self {
        viewBgColor = color;
        return self;
    }
    
    public func navBgColor(_ color: UIColor) -> Self {
        navBgColor = color;
        return self;
    }
    public func navShadowColor(_ color: UIColor) -> Self {
        navShadowColor = color;
        return self;
    }
    public func navStatusBarColor(_ color: UIColor) -> Self {
        navStatusBarColor = color;
        return self;
    }
    public func tableBgColor(_ color: UIColor) -> Self {
        tableBgColor = color;
        return self;
    }
    
    public func refreshTextColor(_ color: UIColor) -> Self {
        refreshTextColor = color;
        return self;
    }
    
    public func refreshTextFont(_ font: UIFont) -> Self {
        refreshTextFont = font;
        return self;
    }
    
    public func errTextColor(_ color: UIColor) -> Self {
        errTextColor = color;
        return self;
    }
    
    public func errTextFont(_ font: UIFont) -> Self {
        errTextFont = font;
        return self;
    }
    
    public func progressTextColor(_ color: UIColor) -> Self {
        progressTextColor = color;
        return self;
    }
    
    public func progressBgColor(_ color: UIColor) -> Self {
        progressBgColor = color;
        return self;
    }
    
    public func progressTextFont(_ font: UIFont) -> Self {
        progressTextFont = font;
        return self;
    }
    
    public func navStatusBarImage(_ image: UIImage) -> Self {
        navStatusBarImage = image;
        return self;
    }
    
    public func build() -> AppConfigureModel {
        let configure = AppConfigureModel();

        configure.viewBgColor = viewBgColor;
        configure.navBgColor = navBgColor;
        configure.navShadowColor = navShadowColor;
        configure.navStatusBarColor = navStatusBarColor;
        configure.tableBgColor = tableBgColor;
        configure.refreshTextColor = refreshTextColor
        configure.refreshTextFont = refreshTextFont;
        configure.errTextColor = errTextColor;
        configure.errTextFont = errTextFont;
        configure.progressTextColor = progressTextColor;
        configure.progressBgColor = progressBgColor;
        configure.progressTextFont = progressTextFont;
        configure.navStatusBarImage = navStatusBarImage;
        
        return configure;
    }


}
